<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<?xml version="1.0" charset="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
"http://www.wapforum.org/DTD/xhtml-mobile10.dtd">

<html>
<head>
  <title>Orden</title>
</head>
<body>
<b>ORDEN # ${sessionScope.order.id}</b><br/>
<font size="2"><i>${sessionScope.customer.name}</i></font><br/>

<form name="form1" action="OrderServlet" method="post">

<u>Categoria:&nbsp;</u>
<select name="pcat">
  <c:forEach var="productCat" items="${sessionScope.pcat}">
    <c:choose>
      <c:when test='${sessionScope.currentCat == productCat}'>
        <option value="${productCat}" selected>${productCat}</option>
      </c:when>
      <c:otherwise>
        <option value="${productCat}">${productCat}</option>
      </c:otherwise>
    </c:choose>
  </c:forEach>
</select>
<input type="submit" value="Agr.Prod" name="action" size="10"/>
<table border="1">
<tr>
  <td>E</td>
  <td>Description</th>
  <td>U</td>
  <td>C</td>
  <td>Sub</td>
  <td>Fecha Req.</td>
</tr>
<c:forEach var="lineProduct" items="${order.products}">
  <tr>
      
  
    <td><a href="OrderServlet?action=del&id=${lineProduct.product.id}&u=${lineProduct.unit}">x</a></td>
    <c:choose>
        <c:when test='${lineProduct.subtotal==0}'>
        <td bgcolor="#FF0000"><b>${lineProduct.product.description}</b></font></td>
      </c:when>
      <c:when test='${lineProduct.outOfStock}'>
        <td bgcolor="#FFFF00"><b>${lineProduct.product.description}</b></font></td>
      </c:when>
      
      <c:otherwise>
        <td>${lineProduct.product.description}</td>
      </c:otherwise>
    </c:choose>
    <td>${lineProduct.unit}</td>
    <td>${lineProduct.quantity}</td>
    <td><fmt:formatNumber value="${lineProduct.subtotal}" pattern="0.00"/></td>
     <td>${lineProduct.product.requiredDate}</td>
  </tr>
</c:forEach>

<tr>
  <td></td>
  <td>Total:</td>
  <td></td>
  <td><fmt:formatNumber value="${order.totalBoxes}" pattern="0.00"/></td>
  <td><fmt:formatNumber value="${order.total}" pattern="0.00"/></td>
</tr>
</table>


<input type="submit" value="Agr.Prod" name="action" size="10"/>
<input type="submit" value="Grabar" name="action" size="10"/>
<input type="submit" value="Cancel" name=action size="10"/>
<br/>


<b> Fecha Requerida del Pedido :${sessionScope.fechaReq}</b>
 <br>
 <!--
<input type="text" name="reqdatday" size="2" maxlength="2"/>
<select name="reqdatmon">
    <option value="0">Ene</option>
    <option value="1">Feb</option>
    <option value="2">Mar</option>
    <option value="3">Abr</option>
    <option value="4">May</option>
    <option value="5">Jun</option>
    <option value="6">Jul</option>
    <option value="7">Ago</option>
    <option value="8">Sep</option>
    <option value="9">Oct</option>
    <option value="10">Nov</option>
    <option value="11">Dic</option>
</select>
<input type="text" name="reqdatyea" size="4" maxlength="4"/><br/> -->


Obs:
<input type="text" name="comments" value="${order.comments}" size="35" maxlength="100" />


</form>

</body>
</html>
